#ifndef RULECHECKER_H
#define RULECHECKER_H

#include "board.h"
#include "pos.h"

class Game;

class RuleChecker
{
    // 成员变量声明
    const Board *board;
    Game* game; 

public:
    // 构造函数声明
    RuleChecker(const Board* b, Game* g);

    // 公有成员函数声明
    bool isValidMove(Pos from, Pos to);

private:
    // 私有成员函数声明
    bool checkche(Pos from, Pos to);
    bool checkma(Pos from, Pos to);
    bool checkxiang(Pos from, Pos to);
    bool checkshi(Pos from, Pos to);
    bool checkShuaiJiang(Pos from, Pos to);
    Pos findJiangPos();
    Pos findShuaiPos();
    bool isRowClear(int start, int end, int row);
    bool checkpao(Pos from, Pos to);
    bool checkBingZu(Pos from, Pos to);
};

#endif